package lab02.test06;

/**
 * Created by dell on 2017/10/15.
 */
public class Circle {
    //Circle类具有类型为double的半径、周长和面积属性，具有返回周长、面积的功能。
    double radius,perimeter,area;
    public Circle(double r) {
        radius = r;
    }
    double area(){
        return 3.14*radius*radius;
    }
    double perimeter() {
        return 2*3.14*radius;
    }
    //行为:返回周长，面积
    void setRadius(double newRadius){
        radius=newRadius;
    }
    double getRadius(){
        return radius;
    }

    public static void main(String[] args) {
        Circle area1=new Circle(9);
        System.out.println("其面积是"+area1.area());
        Circle perimeter=new Circle(9);
        System.out.println("其周长是"+perimeter.perimeter());
    }
}

